package com.li.designpattern.prototype;

import java.util.ArrayList;
import java.util.List;

public class Test {
	public static void main(String[] args) throws CloneNotSupportedException {
		DeepClone sc=new DeepClone();
		sc.setName("lichuangen");
		sc.setAge(24);
		ArrayList<Integer> list=new ArrayList<Integer>();
		list.add(1);
		list.add(2);
		list.add(3);
		sc.setList(list);
		Student a=new Student("li","男");
		sc.setStu(a);
		DeepClone second=(DeepClone) sc.clone();
		a.setName("lichuangen");
		list.add(4);
		System.out.println(second.getName());
		System.out.println(second.getAge());
		System.out.println(second.getList().toString());
		System.out.println(second.getStu().toString());
	}
}
